<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="./../template/StakeholderTemplate.xhtml">

    <ui:define name="contentInsert">
        
        <h3>Add Outlet</h3>
                <h:form>
                    <p:panel id="panel" >
                    <p:ajaxStatus style="width:16px;height:16px;">
                    <f:facet name="start">
                        <h:graphicImage value="http://www.primefaces.org:8080/showcase/design/ajaxloading.gif" />
                    </f:facet>
                    <f:facet name="complete">
                        <h:outputText value="" />
                    </f:facet>
                </p:ajaxStatus>
                <p:messages />
                    <h:panelGrid columns="3">
                        <h:outputLabel for="outletName" value="Outlet name:"/>
                        <p:inputText required="true" requiredMessage="Outlet name is requied!"
                                     id="outletName" value="#{outletManagerBean.outletName}"/>
                        <p:message for="outletName"/>
                        
                        <h:outputLabel for="outletAddress" value="Outlet address:"/>
                        <p:inputText required="true" requiredMessage="Outlet address is requied!"
                                     id="outletAddress" value="#{outletManagerBean.outletAddress}"/>
                        <p:message for="outletAddress"/>

                        <h:outputLabel for="phoneNumber" value="Phone Number: "/>
                        <p:inputText required="true" requiredMessage="Phone Number required"
                                     id="phoneNumber" value="#{outletManagerBean.phoneNumber}"/>
                        <p:message for="phoneNumber"/>

                        <h:outputLabel for="employeeID" value="Outlet Manager ID: "/>
                        <p:inputText required="true" requiredMessage="needs to fill in the Outlet Manager ID!" id="employeeID"
                                     value="#{outletManagerBean.employeeID}">
                        </p:inputText>
                        <p:message for="employeeID"/>
                        
                        <h:outputLabel for="employeeName" value="Outlet Manager Name: "/>
                        <p:inputText required="true" requiredMessage="needs to fill in the Outlet Manager name!" id="employeeName"
                                     value="#{outletManagerBean.employeeName}">
                        </p:inputText>
                        <p:message for="employeeID"/>
                        
                        <h:outputLabel for="employeeEmail" value="Outlet Manager Email: "/>
                        <p:inputText required="true" requiredMessage="needs to fill in the Outlet Manager Email!" id="employeeEmail"
                                     value="#{outletManagerBean.email}">
                        </p:inputText>
                        <p:message for="employeeID"/>
                                       
                    </h:panelGrid>
                    <br/>
                    <br/>
                    <h:commandButton id="createNewOutlet" value="Create Outlet" onclick="if (!confirm('Are you sure you want to create new outlet?')) return false"
                                         action="#{outletManagerBean.createOutlet(event)}" />
                                             
                                </p:panel>
                </h:form>

    </ui:define>

</ui:composition>

